/**
 * @Author YuanYuan
 * @Date 2022/5/13
 * @Time 11:25
 */
class Home {
    public int data1 = 1;
    private int data2 = 2;
    public static int data3 = 3;
    static class Room {
        public int data4 = 4;
        private int data5 = 5;
        public static int data6 = 6;
        public Home home;

        public Room() {
            System.out.println("静态内部类的构造方法!");
        }

        public Room(Home home) {
            System.out.println("静态内部类的构造方法!");
            this.home = home;
        }
        public void fun() {
            //Home home = new Home();
            System.out.println(home.data1);
            System.out.println(home.data2);
            System.out.println(data3);
        }

        @Override
        public String toString() {
            return "Room{" +
                    "data4=" + data4 +
                    ", data5=" + data5 +
                    ", home=" + home +
                    '}';
        }
    }

}
class Person {
    public void func() {
        System.out.println("啥也没有");
    }
}
public class TestDemo {
    public static void main(String[] args) {
        Home.Room room = new Home.Room();
        System.out.println(room);
    }
    public static void main3(String[] args) {
        new Person(){
          public void fun() {
              System.out.println("你是猪");
          }
        }.fun();
     }
    public static void main2(String[] args) {

        Person person = new Person();
        person.func();

        new Person().func();


    }
    public static void main1(String[] args) {
        Home.Room room = new Home.Room(new Home());
    }
}
